{
  "properties" : { },
  "id" : "copy1741939627983d74021",
  "script" : null,
  "groupId" : "b49fd3aa7ab944ca938fd37f3364f0ba",
  "name" : "FX_累计降水量查询(图例)",
  "createTime" : null,
  "updateTime" : 1745214774814,
  "lock" : null,
  "createBy" : "admin",
  "updateBy" : "admin",
  "path" : "/wsprec",
  "method" : "GET",
  "parameters" : [ {
    "name" : "stationkey",
    "value" : null,
    "description" : "站点ID",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "orgid",
    "value" : null,
    "description" : "机构ID",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "btime",
    "value" : "2024-10-20T13:00:00",
    "description" : "结束时间",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "stationtype",
    "value" : "",
    "description" : "站点类型  1. 国家站  2. 区域站 3. 火险监测站(海康)  4:和风天气",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "etime",
    "value" : "2025-03-20T13:00:00",
    "description" : "开始时间",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 0,\n    \"message\": \"success\",\n    \"data\": {\n        \"data\": []\n    },\n    \"timestamp\": 1745214743971,\n    \"executeTime\": 13629\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import com.mingda.weathermagiccenter.utils.WeatherDeal;
import 'java.lang.System' as System;
 
var sql = """
   select a.stationKey,a.orgid,a.orgname,b.prec,a.stationName,a.stationtype from ws_station a
    ,(
    select  stationKey,sum(prec) as prec  from ws_station_data   
    where 1 = 1 
    
     <if test="stationkey != null and stationkey != ''" > and stationKey = #{stationkey} </if>
     <if test="btime != null and btime != ''\" > and TO_TIMESTAMP(replace(#{btime},'T',' '), 'YYYY-MM-DD HH24:MI:SS') <= timeBase </if>
     <if test="etime != null and etime != ''\" > and TO_TIMESTAMP(replace(#{etime},'T',' '), 'YYYY-MM-DD HH24:MI:SS') >= timeBase </if>
     and prec < 100 
     group by stationKey) as b
     where a.stationkey = b.stationkey and 1 = 1

    <if test="orgid != null and orgid != ''" > and a.orgid LIKE CONCAT(#{orgid},'%') </if>
    order by orgid 
"""


    var result = db.select (sql);

return WeatherDeal.getPrecRange(result); 
